//
//  iDemoAppDelegate.m
//  iDemo
//
//  Created by Dr.Watson on 29/05/08.
//  Copyright Passionfools Design 2008. All rights reserved.
//

#import "glclipAppDelegate.h"
#import <UIKit/UIKit.h>
#import "EAGLView.h"

@implementation glclipAppDelegate


- (BOOL) application: (UIApplication*) application
didFinishLaunchingWithOptions: (NSDictionary*) launchOptions {
	
	// 取得瑩幕大小，建立window及glView
	CGRect screenBounds = [[UIScreen mainScreen] bounds];
	window = [[UIWindow alloc] initWithFrame:screenBounds];
	glView = [[EAGLView alloc] initWithFrame:screenBounds];
	
	glView.animationInterval = 1.0 / 60.0;
	
//	bg = [[Texture2D alloc] initWithImagePath:@"bg.jpg"];
//	sprites = [[Texture2D alloc] initWithImagePath:@"planet.png"];
	
	[glView startAnimation];
	
	[window addSubview:glView];
	[window makeKeyAndVisible];
	return YES;
}

/*
 - (void)applicationWillResignActive:(UIApplication *)application {
 glView.animationInterval = 1.0 / 5.0;
 }
 
 
 - (void)applicationDidBecomeActive:(UIApplication *)application {
 glView.animationInterval = 1.0 / 60.0;
 }
 */
- (void)dealloc {
	[window release];
	[glView release];
	[super dealloc];
}

@end
